package gxdlxy.zx2201.loa;

public class Father {
    public String name = "张三";
    private String money = "人民币100百万";
    protected String house = "房子";
    String 财产继承权 = "财产继承权";         // 默认 default

    void print() {
        Father f = new Father();
        System.out.println(f.name);
        System.out.println(f.house);
        System.out.println(f.财产继承权);
        System.out.println(f.money);   // 没有权限
    }
}
// 相同包的子类或者其他类
class Son extends Father{
    void print() {
        Father f = new Father();
        System.out.println(f.name);
        System.out.println(f.house);
        System.out.println(f.财产继承权);
//        System.out.println(f.money);   // 没有权限
    }
}
